#ifndef CAMPAIGNSETTINGDATAFORM_H
#define CAMPAIGNSETTINGDATAFORM_H


#include <CampaignSetting.h>
#include <ItemModel.h>


#include <QWidget>
#include <QPointer>
#include <QActionGroup>
#include <QSortFilterProxyModel>


namespace Ui {
    class CampaignSettingDataForm;
}


static const char* P_CAMPAIGN_NAME = "P_CAMPAIGN_NAME";


class CampaignSettingDataForm : public QWidget
{
    Q_OBJECT

public:

    explicit CampaignSettingDataForm(CampaignSetting* root, QWidget *parent = 0);
    ~CampaignSettingDataForm();


signals:

    void sigDirty();


public slots:

    void onSave();
    void onSaveAs();
    void onClose();
    void onUpdateData();


protected slots:

    void onDirty();
    void onActionTriggered(QAction*);


private:

    Ui::CampaignSettingDataForm *ui;
    ItemModel* m_model;
    QPointer<CampaignSetting> m_root;
    QActionGroup* m_actions;

    void initializeActions();

    QSortFilterProxyModel* m_dataModel;
    QSortFilterProxyModel* m_selectionModel;

private slots:

    void on_comboBoxCharacterClass_currentIndexChanged(QString );
    void on_comboBoxCharacterClass_currentIndexChanged(int index);
    void on_actionPrev_Page_triggered();
    void on_actionNext_Page_triggered();
    void on_lineEditName_editingFinished();


};


#endif // CAMPAIGNSETTINGDATAFORM_H

